/**
 * container
 * Created by li-rz on 16-12-7.
 */

import './PersonalContainer.scss'
import React from 'react';
import Mixin from '../../../both/Mixin.jsx';
class PersonalContainer extends React.Component {
    constructor(props) {
        super(props);
    }

    getClass() {
        var returnClass = '';
        if (this.props.fluid) {
            returnClass += Mixin.getClassSet('fluid', 'container');
        }
        if (this.props.padding) {
            returnClass += Mixin.getClassSet('container') + ' ' +
                Mixin.getClassSet('container', 'padding');
        }
        if(this.props.bgColor){
            returnClass += Mixin.getClassSet("container","bg", 'color');
        }

        return returnClass;
    }

    render() {
        return React.createElement('div', {
            className: this.getClass(),
            style : this.props.minHeight ?
                {minHeight: this.props.minHeight + 'px' }:
                {}
        }, this.props.children);
    }
}

PersonalContainer.PropTypes = {
    fluid: React.PropTypes.bool,
    padding: React.PropTypes.bool,
    minHeight: React.PropTypes.number
};

PersonalContainer.defaultProps = {
    fluid: false,
    padding: false,
    bgColor : true
};

export default PersonalContainer;